﻿namespace MemberManagement.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitTable : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Member",
                c => new
                    {
                        Id = c.String(nullable: false, maxLength: 36, storeType: "nvarchar"),
                        CardNumber = c.String(maxLength: 100, storeType: "nvarchar"),
                        Name = c.String(maxLength: 36, storeType: "nvarchar"),
                        IdCard = c.String(maxLength: 36, storeType: "nvarchar"),
                        Mobile = c.String(maxLength: 36, storeType: "nvarchar"),
                        Balance = c.Decimal(nullable: false, precision: 18, scale: 2),
                        CreateTime = c.DateTime(nullable: false, precision: 0),
                        ModifyTime = c.DateTime(nullable: false, precision: 0),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Recharge",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        MemberId = c.String(maxLength: 36, storeType: "nvarchar"),
                        Amount = c.Decimal(nullable: false, precision: 18, scale: 2),
                        Balance = c.Decimal(nullable: false, precision: 18, scale: 2),
                        Type = c.Int(nullable: false),
                        CreateTime = c.DateTime(nullable: false, precision: 0),
                        Remark = c.String(unicode: false),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.SysConfig",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Key = c.String(maxLength: 100, storeType: "nvarchar"),
                        Value = c.String(maxLength: 100, storeType: "nvarchar"),
                        Remark = c.String(maxLength: 100, storeType: "nvarchar"),
                    })
                .PrimaryKey(t => t.Id);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.SysConfig");
            DropTable("dbo.Recharge");
            DropTable("dbo.Member");
        }
    }
}
